
import request from '@/utils/request'

export function saveAllManufactureTask(data) {
  return request({
    url: '/api/mes/task/save_all',
    method: 'post',
    data
  })
}

export function pageManufactureTask(data) {
  return request({
    url: '/api/mes/task/page',
    method: 'post',
    data
  })
}

export function pageGoodsManufactureTask(data) {
  return request({
    url: '/api/mes/task/page_goods',
    method: 'post',
    data
  })
}

export function listPreOptions() {
  return request({
    url: '/api/mes/task/list_pre_options',
    method: 'get'
  })
}

export function saveAllManufactureTaskRecord(data) {
  return request({
    url: '/api/mes/task/save_all_record',
    method: 'post',
    data
  })
}

export function listManufactureTaskRecord(data) {
  return request({
    url: '/api/mes/task/list_record',
    method: 'post',
    data
  })
}

export function getTaskList(data) {
  return request({
    url: '/api/mes/task/list',
    method: 'post',
    data
  })
}

export function getListPreOptions() {
  return request({
    url: '/api/mes/task/list_pre_options',
    method: 'get'
  })
}

/**
 * @description: 更新生产记录
 * @param {*} data
 * @return {*}
 */
export function updateTaskLog(data) {
  return request({
    url: '/api/mes/task/update',
    method: 'post',
    data
  })
}


/**
 * @description: 获取任务单号id
 * @param {*} data
 * @return {*}
 */
export function listOwnerTaskCode(data) {
  return request({
    url: '/api/mes/task/list_owner_task_code',
    method: 'post',
    data
  })
}

/**
 * @description: 根据id查询任务单号data
 * @param {*} data
 * @return {*}
 */
export function getManufactureTaskData(data) {
  return request({
    url: '/api/mes/task/get',
    method: 'post',
    data
  })
}

/**
 * @description: 根据id保存任务设备
 * @param {*} data
 * @return {*}
 */
export function saveAllEquipment(data) {
  return request({
    url: '/api/mes/task/save_all_equipment',
    method: 'post',
    data
  })
}

/**
 * @description: 复核
 * @param {*} data
 * @return {*}
 */
export function saveCheckEquipment(data) {
  return request({
    url: '/api/mes/task/check',
    method: 'post',
    data
  })
}